package com.demo.javaDemo.fun;

public class MathDemo {

	public static void main(String[] args) {
		long k=10;
		long n= 5;//countPrime(2*k);
		System.out.format("%s has %s prime number>>>>%s",2*k-1,n,(2*n>k));
	}
	
	
	public static long countPrime(long n) {
		int count=0;
		for(long i=1;i<=n;i+=2) {
			if(isPrimeNum(i)) {
				count++;
			}
		}
		return count;
	}
	
	 public static boolean isPrimeNum(long n){
	       if (n <= 3) {
	            return n > 1;
	        }
	        
	       for(int i=2;i<=Math.sqrt(n);i++){
	           if(n%i == 0) {
	        	   return false;
	           }
	       }
	       return true;
	   }

	
	

}
